#ifndef DEFECTDAO_H
#define DEFECTDAO_H

#include <QSqlError>
#include <QSqlQuery>
#include "defect.h"

class DefectDao
{
public:
    DefectDao();

private:
    QSqlQuery query;

public:
    int insert(Defect &defect);
    int updateByPrimay(Defect &defect);
    int deleteByPrimay(Defect &defect);
    int queryAll(QList<Defect *> &list);
    int queryByDetectionId(QList<Defect *> &list, int detectionId);
};

#endif // DEFECTDAO_H
